#!/bin/bash
set -euo pipefail
BaseDir=$(cd "$(dirname "$0")"; pwd)
cd ${BaseDir}

op=${1-312}
case $op in
    312)
        echo "312"
        pyenv local 3.12.0
        python --version
        pip install -r ./v2.txt

        flask run

        curl http://127.0.0.1:5000/hi
        curl http://127.0.0.1:5000/greet/wushifeng
        #进入flask context 执行command
        # source /root/.bash_profile 
        # pyenv local 3.12.0
        # flask hello
        ;;
    *)
        # https://github.com/greyli/helloflask/blob/master/docs/installation.md
        python3 -m venv env
        . env/bin/activate
        ;;
esac

